import request from '@/utils/request.js'

export const listservice =()=>{
   return request.get("product/list")
}

export const  addservice=(productdata)=>{

   return request.post('/product/add',productdata)
}

export const deleteservice =(id)=>{

   return request.delete('/product/delete?id='+id)

}
export const selectbyid=(id)=>{
   return request.get('/product/selectbyid?id='+id)
}

export const getpagecount =()=>{
   return request.get("/product/getCount")
}

export const pageListservice =(curPage,pageSize)=>{

   return request.get(`/product/pageList?curPage=${curPage}&pageSize=${pageSize}`)

}

export const  updateservice =(newdate)=>{
   return request.post('/product/update',newdate)

}

export const deleteSelectedService = (selectedIds) => {
   return request.post('/product/deleteproducts', selectedIds);
}
